//
//  ViewController.m
//  ALCache
//
//  Created by xujingjing on 16/6/13.
//  Copyright © 2016年 xujingjing. All rights reserved.
//

#import "ViewController.h"
#import "AllPingJiaVC.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatPath];
  //  [self readCache];
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)readCache{
    /*
    NSString *path=[NSString stringWithFormat:@"%@/Documents/%@",NSHomeDirectory(),[self.url MD5Hash]];
    //判断是否有缓存 缓存路径是否为真
    NSFileManager *fm = [NSFileManager defaultManager];
    [fm fileExistsAtPath:path];
    
    if([fm fileExistsAtPath:path]){//如果为真 证明有缓存
        //读取缓存数据
        
        NSMutableData *data =[NSMutableData dataWithContentsOfFile:path];
    }
    */
    
}
- (void)creatPath{
   
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
                                                         
                                                         NSUserDomainMask, YES);
    
    NSString *cachesDirectory = [paths objectAtIndex:0];
    
    cachesDirectory = [cachesDirectory
                       
                       stringByAppendingPathComponent:@"MyAppCache"];
    NSLog(@"NSDocumentDirectory:%@",cachesDirectory);
}

- (IBAction)SeeEvalute:(UIButton *)sender {
    [self.navigationController pushViewController:[[AllPingJiaVC alloc] init] animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
